package com.itump.base.util;

public class ExceptionInfo {
	// 异常编码 异常类型 异常友好提示
	private static final String exceptionInfoStrs[][] = {
			{ "00001", "ActiveDirectoryObjectExistsException",
					" 创建了 Active Directory 对象且该对象在基础目录存储区中已存在" },
			{ "00002", "ActiveDirectoryObjectNotFoundException",
					" 在基础目录存储区中找不到请求的对象" },
			{ "00003", "ActiveDirectoryOperationException", " 基础目录操作失败" },
			{ "00004", "ActiveDirectoryServerDownException", " 服务器无法响应服务请求" },
			{ "00005", "ArgumentException", " 方法的参数是非法的" },
			{ "00006", "ArgumentNullException", " 一个空参数传递给方法，该方法不能接受该参数" },
			{ "00007", "ArgumentOutOfRangeException", " 参数值超出范围" },
			{ "00008", "ArithmeticException", " 出现算术上溢或者下溢" },
			{ "00009", "ArrayTypeMismatchException", " 在数组中存储错误类型的对象" },
			{ "00010", "BadImageFormatException", " 图形的格式错误" },
			{ "00011", "CodeDomSerializerException", " 产生序列化错误的行号信息" },
			{ "00012", "ConfigurationErrorsException", " 记取配制错误" },
			{ "00013", "ConfigurationException", " 配置设置中发生错误" },
			{ "00014", "ConstraintException", " 使用指定的字符串和内部异常初始化" },
			{ "00015", "CryptographicException", " 加密操作过程中发生错误" },
			{ "00016", "DataException", " 使用ADO.NET时发生的意外" },
			{ "00017", "DBConcurrencyException",
					" 在升级操作中，DataAdapter 确定受影响的行数等于零" },
			{ "00018", "DbException", " 数据源引发的所有异常的基类" },
			{ "00019", "DeletedRowInaccessibleException", " 删除行出错" },
			{ "00020", "DirectoryException",
					" 用作所有 System.DirectoryServices.Protocols 异常的基类" },
			{ "00021", "DirectoryServicesCOMException", " 调用Invoke方法时发生错误" },
			{ "00022", "DivideByZeroException", " 除零异常" },
			{ "00023", "DllNotFoundException", " 找不到引用的DLL" },
			{ "00024", "DuplicateNameException", " 不允许重复的数据库对象名称" },
			{ "00025", "EvaluateException",
					" 无法计算DataColumn的Expression属性时引发的异常" },
			{ "00026", "ExceptionCollection", " 异常的集合" },
			{ "00027", "ExceptionShow", " ExceptionShow" },
			{ "00028", "FormatException", " 参数格式错误" },
			{ "00029", "IndexOutOfRangeException", " 数组索引超出范围" },
			{ "00030", "InRowChangingEventException",
					" RowChanging 事件中调用 EndEdit 方法时引发的异常" },
			{ "00031", "InstallException", " 安装的提交、回滚或卸载阶段发生错误" },
			{ "00032", "InvalidcastException", " 无效的强制类型转换或显式转换" },
			{ "00033", "InvalidConstraintException", " 表示在不正确地尝试创建或访问关系时引发的异常" },
			{ "00034", "InvalidExpressionException",
					" 将包含无效Expression的DataColumn添加到DataColumnCollection中时引发异常" },
			{ "00035", "InvalidOperationException", " 方法的调用时间错误" },
			{ "00036", "LicenseException", " 无法为组件授予许可证" },
			{ "00037", "MembershipCreateUserException", " 未成功创建用户" },
			{ "00038", "MembershipPasswordException", " 无法从密码存储区检索到密码" },
			{ "00039", "MethodAccessException", " 试图访问思友或者受保护的方法" },
			{ "00040", "MissingMemberException", " 访问一个无效版本的DLL" },
			{ "00041", "NoNullAllowedException",
					" 将空值插入列而AllowDBNull设置为false时引发的异常" },
			{ "00042", "NotFiniteNumberException", " 对象不是一个有效的成员" },
			{ "00043", "NotSupportedException", " 调用的方法在类中没有实现" },
			{ "00044", "NullReferenceException", " 试图使用一个未分配的引用" },
			{ "00045", "OutOfMemoryException", " 内存空间不够" },
			{ "00046", "PolicyException", " 策略禁止代码运行" },
			{ "00047", "ProviderException", " 配置提供程序错误" },
			{ "00048", "ReadOnlyException", " 更改只读列的值时引发的错误" },
			{ "00049", "RowNotInTableException", " 在不位于DataTable里的DataRow上执行操作" },
			{ "00050", "SecurityException", " 检测到安全性错误" },
			{ "00051", "SerializationException", " 序列化或反序列化过程中发生错误" },
			{ "00052", "SettingsPropertyIsReadOnlyException",
					" 只读 SettingsProperty 对象" },
			{ "00053", "SettingsPropertyNotFoundException",
					" 未找到的 SettingsProperty 对象" },
			{ "00054", "SettingsPropertyWrongTypeException",
					" SettingsProperty 对象使用无效类型" },
			{ "00055", "SmtpException",
					" 当 SmtpClient 无法完成 Send 或 SendAsync 操作时错误" },
			{ "00056", "SQLException", " 运行的 SQL 命令错误" },
			{ "00057", "StackOverflowException", " 待定的方法调用太多，导致执行堆栈溢出" },
			{ "00058", "StrongTypingException", " 访问DBNull值时,强类型DataSet引发的异常" },
			{ "00059", "SUDSGeneratorException",
					" 生成 Web 服务描述语言 (WSDL) 的过程中发生错误" },
			{ "00060", "SUDSParserException", " 分析 Web 服务描述语言 (WSDL) 的过程中发生错误" },
			{ "00061", "SyncFromAllServersOperationException",
					" 来自所有服务器的同步请求失败" },
			{ "00062", "SyntaxErrorException",
					" 在DataColumn的Expression属性包含语法错误时引发的异常" },
			{ "00063", "SystemException", " 其他用户可处理的异常的基本类" },
			{ "00064", "TimeoutException", " 指定的超时已过期" },
			{ "00065", "TypedDataSetGeneratorException", " 生成强类型DataSet时发生名称冲突" },
			{ "00066", "VersionNotFoundException", " 尝试返回已经删除的DataRow版本出错" },
			{ "00067", "ViewStateException", " 无法加载或验证视图状态" },
			{ "00068", "WarningException", " 异常被作为警告而不是错误处理" },
			{ "00069", "XmlSyntaxException", " XML 分析时出现语法错误" },
			{ "00070", "XsltException", " XSLT 转换而发生错误" },
			{ "00071", "IOException", " IO异常" },
			{ "00072", "NullPointerException", " 空指针异常" },
			{ "00073", "NumberFormatException", "数字类型转化异常" },
			{ "00074", "FileNotFoundException", "文件无法找到异常" },
			{ "00075", "SQLGrammarException", "SQL语法异常" },
			{ "00076", "SQLDataException", "SQL数据异常" },
			{ "00077", "ClassNotFoundException", "类无法找到异常" },
			{ "00078", "BufferOverflowException", "缓冲溢出" },
			{ "00079", "ArrayIndexOutOfBoundsException", "数组越界异常" },
			{ "00080", "OutOfMemoryError", "内存不足" },
			{ "00081", "EOFException", "文件已结束异常" },
			{ "00082", "NoSuchMethodException", "方法未找到异常" },
			{ "00083", "NoSuchMethodError", "方法不存在错误" },
			{ "00084", "ArrayIndexOutOfBoundsException", "数组索引越界异常" },
			{ "00085", "ArrayStoreException", "数组存储异常" },
			{ "00086", "CloneNotSupportedException", "不支持克隆异常" },
			{ "00087", "IndexOutOfBoundsException", "索引越界异常" },
			{ "00088", "NegativeArraySizeException", "数组大小为负值异常" },
			{ "00089", "StringIndexOutOfBoundsException", "字符串越界错误" },
			{ "00090", "TypeNotPresentException", "类型不存在异常" },
			{ "00091", "UnsupportedOperationException", "不支持的方法异常" },
			{ "00092", "IllegalAccessException ", "没有访问权限" },
			{ "00093", "InstantiationError", "实例化错误" },
			{ "00094", "StackOverflowError", "堆栈溢出错误" },
			{ "00095", "RuntimeException", "运行期间抛出的异常" },
			{ "00096", "AbstractMethodError", "抽象方法错误" },
			{ "00097", "NoClassDefFoundError", "未找到类定义错误" },
			{ "00098", "UnsupportedClassVersionError", "不支持的类版本错误" },
			{ "00099", "AssertionError", "断言错误" }, };

	public static String[] getExceptionInfoFromName(String exName) {
		for (int i = 0; i < exceptionInfoStrs.length; i++) {
			if (exceptionInfoStrs[i][1].toString().equalsIgnoreCase(exName)) {
				return exceptionInfoStrs[i];
			}
		}
		return null;

	}

	public static String[] getExceptionInfoFromId(String exId) {
		for (int i = 0; i < exceptionInfoStrs.length; i++) {
			if (exceptionInfoStrs[i][0].toString().equalsIgnoreCase(exId)) {
				return exceptionInfoStrs[i];
			}
		}
		return null;
	}

	public static String[][] getExceptionInfoStrs() {
		return exceptionInfoStrs;
	}
}
